package com;

import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;

/**
 * Created by IntelliJ IDEA.
 * User: BGONZ8
 * Date: 9/24/11
 * Time: 11:50 AM
 * To change this template use File | Settings | File Templates.
 */
public class RestGetTestCase extends AbstractTestCase
{

    public RestGetTestCase() throws Exception
    {
        super();
    }

    public RestGetTestCase(String endpoint, String requestParameters)  throws Exception
    {
        super();
        this.endpoint = endpoint;
        this.requestParameters = requestParameters;
    }

    public String getResult() {

        String retval = "";
        retval = retval + "\n\n ============================= REST GET TEST CASE ========================================\n\n";
        retval = retval + "\n\n" + "Comment:\n" + this.getUserComment()+ "\n\n" ;
        retval = retval + this.getEndpoint() + "?" + this.getRequestParameters() + "\n\n";
        retval = retval +  reply;
        return retval;
    }
    public void submit() throws Exception
    {
        try
        {
            reply = reply + util.sendGetRequest(endpoint, requestParameters) + "\n\n";
        }
        catch(Exception e)
        {
            reply = reply + "ERROR: " + e.getMessage() + "\n\n";
        }
    }



}
